package com.ddf.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ddf.exception.GlobalCustomizeException;
import com.ddf.exception.GlobalExceptionEnum;

@Controller
@RequestMapping("/requestMapping")
public class HelloWorldServlet {
	private static final String SUCCESS = "success";
	private Logger log = LoggerFactory.getLogger(this.getClass());
	@RequestMapping("/helloWorld")
	public String helloWorld() {
		log.info("hello world!");
		return SUCCESS;
	}
	
	@RequestMapping("/testException")
	public void testException() {
		log.error("fjwoefjowjffwefweew");
		throw new GlobalCustomizeException(GlobalExceptionEnum.UNKNOW_ERROR);
	}
}
